
const toYuan = (money,format) => {
    if(money === 0) {
    	if(format == 'int') return '0'
    	else return '0.00'
    }
    else if(!money || money=="--") {
    	if(format == 'int') return '0'
    	else return '0.00'
    }
    else {
    	if(format == 'format') return (money/100).toFixed(2).replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
    	else if(format == 'int') return (money/100).toFixed(0)
    	else return (money/100).toFixed(2)
    }
}

export default toYuan
